package Tree.HuffmanTree;

import java.util.Map;

public class HuffmanTreeTest {
    public static void main(String[] args) {
        HuffmanTree integerHuffmanTree = new HuffmanTree("浩鑫你就是个几把啊，你就是个几把啊");
        integerHuffmanTree.preorder();
        Map<Character, String> huffmanCode = integerHuffmanTree.getHuffmanCode();
        for (Map.Entry<Character,String> map : huffmanCode.entrySet()){
            System.out.println(map.getKey()+","+map.getValue());
        }
        System.out.println(integerHuffmanTree.TextToHuffmanCode("浩鑫你就是个几把啊，你就是个几把啊"));
        System.out.println(integerHuffmanTree.decode("11001101111100110101000001110011101111001101010000011100"));
    }
}
